package com.hunt.model.dto;

import com.alibaba.fastjson.JSONObject;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;
import java.util.UUID;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class FinancialSimpleDataInfoPO implements Serializable {

    private String id;

    private String ts_code;

    private String symbol;

    private String name;

    private String area;

    private String industry;

    private String list_date;

    private String totalShares;

    private String floatShares;

    private boolean isShutdown = false;
    public FinancialSimpleDataInfoPO(FinancialData financialData){
        String upperCode = financialData.getThs_thscode_stock();
        if (financialData.getThs_is_shutdown().equals("1")){
            this.isShutdown = true;
        }
        this.id = UUID.randomUUID().toString().replaceAll("-","");
        this.ts_code = upperCode.toLowerCase();
        this.symbol = financialData.getThs_stock_code_stock();
        this.name = financialData.getThs_stock_short_name_stock();
        this.area = financialData.getThs_province_stock();
        this.industry = financialData.getThs_the_sw_industry_stock();
        this.list_date = financialData.getThs_ipo_date_stock();
        this.totalShares = financialData.getThs_total_shares_stock();
        this.floatShares = financialData.getThs_total_float_shares_stock();
    }
}
